package com.tao.YanMoDesignPattern.composite.case3_ring;


/**
 * @Author Mi_Tao
 * @Date 2023/8/27
 * @Description
 * @Version 1.0
 **/
public class Client
 {

    public static void main(String[] args){
        // 定义多个Composite对象
        Component root = new Composite("服装");
        Component c1 =   new Composite("男装");
        Component c2 =   new Composite("衬衣");
        Component c3 =   new Composite("男装");

        // 组合成属性的对象结构
        root.addChild(c1);
        c1.addChild(c2);
        c2.addChild(c3);

        // 操作Component 对象
        root.printStruct("");


    }
}
